﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Money
{
    public partial class EditTransactionForm : Form
    {
        private Transaction _transaction;

        public Transaction Transaction
        {
            get { return _transaction; }
            set 
            { 
                _transaction = value;
                _transactionGui.Transaction = _transaction;
            }
        }

        public EditTransactionForm()
        {
            InitializeComponent();

            _transactionGui.Mode = Money.GUI.TransactionGUI.FormMode.Form;
        }

        private void _transactionGui_FinishedEdit(object sender, EventArgs e)
        {
            DialogResult = System.Windows.Forms.DialogResult.OK;
        }

        private void _transactionGui_Cancelled(object sender, EventArgs e)
        {
            DialogResult = System.Windows.Forms.DialogResult.Cancel;
        }
    }
}
